<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   <base href="<%=basePath%>">
    
  <title>My JSP 'showNews.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="js/jquery.min.js"></script>
  </head>
  
  <body>
    This is my showNews page. <br>
    <hr>
    <ul>
    <li><a href="index.jsp">发布新闻页</a></li>
    <li><a href="listNews.jsp">新闻列表页</a></li>
    </ul>
    
    <h1></h1>
    <h2></h2>
    <p></p>
    <script type="text/javascript"> 
	$.ajax({
   		url: "showNewsAction.action",
   		type:'jsonp',
   		success: function(msg){	
     		//alert("author"+msg.news[0].author);
     		$("h1").append(msg.news[0].title);
     		$("h2").append(msg.news[0].author);
     		$("p").append(msg.news[0].content);
   		}
	});
</script>
  </body>
</html>
